package com.compass.mobile.presenters

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.leanback.widget.Presenter
import androidx.recyclerview.widget.LinearLayoutManager
import com.compass.mobile.R
import com.compass.mobile.framework.ext.gone
import com.compass.mobile.framework.ext.visible
import com.compass.mobile.framework.utils.BigDecimalUtils
import com.compass.mobile.framework.utils.DateUtils
import com.compass.mobile.models.Inspection
import com.compass.mobile.models.OrderBean
import com.compass.mobile.models.ProjectRespVOS
import com.compass.mobile.presenters.MyInspectionPresenter.ViewHolder
import com.compass.mobile.ui.adapter.InspectionItemAdapter
import dp2px
import setUrlRound

/**
 * Description：
 * Date:2024/7/3 19:51
 */
class InspectionItemPresenter: Presenter() {

    override fun onCreateViewHolder(viewGroup: ViewGroup): ViewHolder {
        val view = LayoutInflater.from(viewGroup.context)
            .inflate(R.layout.item_inspection_order, viewGroup, false)
        return ViewHolder(view)
    }

    override fun onBindViewHolder(viewHolder: Presenter.ViewHolder, item: Any) {
        if (item is ProjectRespVOS) {
            val vh = viewHolder as ViewHolder
            vh.tvTitle.text = item.inspectionName
            vh.tvValue.text = item.executeDepartmentAdress
            vh.tvPrice.text = "￥${item.price}元"

        }
    }

    override fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder) {

    }


    class ViewHolder(view: View) : Presenter.ViewHolder(view) {
        var tvTitle: TextView = view.findViewById(R.id.tv_title)
        var tvValue: TextView = view.findViewById(R.id.tvValue)
        var tvPrice: TextView = view.findViewById(R.id.tvPrice)
    }
}